package com.hfy.user.controller;

import com.hfy.user.service.MessageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

/**
 * @ author 韩
 * time: 2024/11/6 18:56
 */

@RestController
@RequestMapping("/message")
@Tag(name = "消息操作的控制器" ,description = "对消息进行一些管理操作")
public class MessageController {

    @Autowired
    private MessageService messageService;

    @GetMapping("/record/{sessionId}")
    @Operation(summary = "获取一个会话的消息记录", description = "通过sessionId获取消息记录")
    @Parameters({@Parameter(name = "sessionId", description = "会话ID")})
    public Result getRecord(@PathVariable("sessionId") String sessionId) {
        return messageService.getRecordBySessionId(sessionId);
    }
}
